﻿using System;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using XRM.Security.DataAccess.Interfaces;

namespace XRM.Security.DataAccess.Models
{
    [Table("UserSkzi")]
    public class UserSkzi : IUserRegister
    {
        [Key]
        [DatabaseGeneratedAttribute(DatabaseGeneratedOption.Identity)]
        public int UserSkziId { get; set; }

        public int UserRegisterId { get; set; }
        public int SkziKindId { get; set; }
        public int PCId { get; set; }

        [MaxLength(100)]
        [Required]
        public string CopyNumber { get; set; }

        public DateTime SetupDate { get; set; }
        public int SetupSystemUserId { get; set; }

        public DateTime? DeleteDate { get; set; }
        public int? DeleteSystemUserId { get; set; }
        [MaxLength(500)]
        public string DeleteReason { get; set; }

        [ForeignKey("UserRegisterId")]
        public virtual UserRegister UserRegister { get; set; }
        [ForeignKey("SkziKindId")]
        public virtual SkziKind SkziKind { get; set; }
        [ForeignKey("PCId")]
        public virtual PC PC { get; set; }
        [ForeignKey("SetupSystemUserId")]
        public virtual SystemUser SetupSystemUser { get; set; }
        [ForeignKey("DeleteSystemUserId")]
        public virtual SystemUser DeleteSystemUser { get; set; }
    } 
}
